//导入请求类
import Http from "../utils/Http"
//地址请求类
import url from "../utils/url"
//地址缓存类
import cache from "../utils/Cache"
class Model extends  Http{
    getLists(page=1){
       return  this.httpRequest({
            url:url.articles,
            data:{
               page
            }
        })
    }
    //根据文章id返回对应的数据
    detail(article){
      return this.httpRequest({
        url:url.articles+"/"+article,
      })  
    }
    //资讯统计
    articleCount(art_id){
      return this.httpRequest({
        url:url.articlesCount,
        data:{
          //用户id
          rid:cache.get('id'),
          //文章id
          art_id
        },
        method:"POST"
      })
    }

}
export default new Model;